package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTextField;

public class ContactForm{
	
	
	private JTextField JTextFieldFname;
    private JTextField JTextFieldLname;
    private JTextField JTextFieldGroup;
    private JTextField JTextFieldAddressH;
    private JTextField JTextFieldAddressC;
    private JTextField JTextFieldPhoneH;
    private JTextField JTextFieldPhoneM;
    private JTextField JTextFieldPhoneP;
    private JTextField JTextFieldEmailPers;
    private JTextField JTextFieldEmailProf;
    private JTextField JTextFieldWebPage;
    private JTextField JTextFieldBrowseIMG;
    private JButton JButtonBrowseIMG;
    private JButton JButtonValidate;
    public static JFrame jframe1;
    private JMenuBar jmenu;
    private JMenu Option;
    private JMenuItem Quitter;
    public static final int NbCol = 5;
    
    
	
	
	public ContactForm() {
		
		 //affiche la jframe
       // jframe1.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	}

    
    
	public void Menu(String cols[] ) {

	        jframe1 = new javax.swing.JFrame();
	        JTextFieldFname = new javax.swing.JTextField();
	        JTextFieldLname = new javax.swing.JTextField();
	        JTextFieldGroup = new javax.swing.JTextField();
	        JTextFieldAddressH = new javax.swing.JTextField();
	        JTextFieldAddressC = new javax.swing.JTextField();
	        JTextFieldPhoneH = new javax.swing.JTextField();
	        JTextFieldPhoneM = new javax.swing.JTextField();
	        JTextFieldPhoneP = new javax.swing.JTextField();
	        JTextFieldEmailPers = new javax.swing.JTextField();
	        JTextFieldEmailProf = new javax.swing.JTextField();
	        JTextFieldWebPage = new javax.swing.JTextField();
	        JTextFieldBrowseIMG = new javax.swing.JTextField();
	        JButtonValidate = new javax.swing.JButton();
	        JButtonBrowseIMG = new javax.swing.JButton();
	        jmenu = new javax.swing.JMenuBar();
	        Option = new javax.swing.JMenu("Option");
	        Quitter = new javax.swing.JMenuItem("Quitter");


	        // Affichage de la jdialog affichait de base
	        jframe1.setTitle("__ :: Address Book :: __");
	        jframe1.setMinimumSize(new java.awt.Dimension(350, 700));
	        jframe1.setResizable(false);
	        jframe1.setLayout(null);

	        // Affichage des boutons des IA
	        JTextFieldFname.setText(cols[0]);
	        jframe1.getContentPane().add(JTextFieldFname);
	        JTextFieldFname.setBounds(10, 10, 145, 23);

	        JTextFieldLname.setText(cols[1]);
	        jframe1.getContentPane().add(JTextFieldLname);
	        JTextFieldLname.setBounds(10, 60, 145, 23);

	        JTextFieldGroup.setText(cols[2]);
	        jframe1.getContentPane().add(JTextFieldGroup);
	        JTextFieldGroup.setBounds(10, 110, 145, 23);

	        JTextFieldAddressH.setText(cols[3]);
	        jframe1.getContentPane().add(JTextFieldAddressH);
	        JTextFieldAddressH.setBounds(10, 160, 145, 23);
	        
	        JTextFieldAddressC.setText(cols[4]);
	        jframe1.getContentPane().add(JTextFieldAddressC);
	        JTextFieldAddressC.setBounds(10, 210, 145, 23);

	        JTextFieldPhoneH.setText(cols[5]);
	        jframe1.getContentPane().add(JTextFieldPhoneH);
	        JTextFieldPhoneH.setBounds(10, 260, 145, 23);
	        
	        JTextFieldPhoneM.setText(cols[6]);
	        jframe1.getContentPane().add(JTextFieldPhoneM);
	        JTextFieldPhoneM.setBounds(10, 310, 145, 23);
	        
	        JTextFieldPhoneP.setText(cols[7]);
	        jframe1.getContentPane().add(JTextFieldPhoneP);
	        JTextFieldPhoneP.setBounds(10, 360, 145, 23);

	        JTextFieldEmailPers.setText(cols[8]);
	        jframe1.getContentPane().add(JTextFieldEmailPers);
	        JTextFieldEmailPers.setBounds(10, 410, 145, 23);

	        JTextFieldEmailProf.setText(cols[9]);
	        jframe1.getContentPane().add(JTextFieldEmailProf);
	        JTextFieldEmailProf.setBounds(10, 460, 145, 23);
	        
	        JTextFieldWebPage.setText(cols[10]);
	        jframe1.getContentPane().add(JTextFieldWebPage);
	        JTextFieldWebPage.setBounds(10, 510, 145, 23);
	        
	        JTextFieldBrowseIMG.setText("src\\contact.png");
	        jframe1.getContentPane().add(JTextFieldBrowseIMG);
	        JTextFieldBrowseIMG.setBounds(10, 560, 145, 23);
	        
	        JButtonBrowseIMG.setText("Browser Image");
	        jframe1.getContentPane().add(JButtonBrowseIMG);
	        JButtonBrowseIMG.setBounds(180, 560, 145, 23);
	        
	        JButtonValidate.setText("Send");
	        jframe1.getContentPane().add(JButtonValidate);
	        JButtonValidate.setBounds(10, 610, 315, 23);
	        
	        
	    
	        System.out.println("\n\n\n");

	        // Ajout des sous menu de Option
	        Option.add(Quitter);
	        
	        Quitter.setMnemonic(KeyEvent.VK_Q);
	        Option.setMnemonic(KeyEvent.VK_ALT);

	        // Ajouter les menu sur la bar de menu
	        jmenu.add(Option);
	        
	        
	        

	        // On gere les clics de la souris pour notre menu
	        Quitter.addActionListener(new ActionListener() {
	            @Override
	            public void actionPerformed(ActionEvent e) {
	                System.exit(0);
	            }
	        });


	        // On affiche gere la fenetre
	       // jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Vue/Images/FondAcceuil12.jpg"))); // NOI18N
//	        jLabel1.setText("jLabel1");
//	        jframe1.Fname(jLabel1);
//	        jLabel1.setBounds(0, 0, 900, 599);

	        
	        // On met le bar menu
	        jframe1.setJMenuBar(jmenu);
	        jframe1.setVisible(true);

	}

	

	/**
	 * @return the jTextFieldBrowseIMG
	 */
	public JTextField getJTextFieldBrowseIMG() {
		return JTextFieldBrowseIMG;
	}



	/**
	 * @param jTextFieldBrowseIMG the jTextFieldBrowseIMG to set
	 */
	public void setJTextFieldBrowseIMG(JTextField jTextFieldBrowseIMG) {
		JTextFieldBrowseIMG = jTextFieldBrowseIMG;
	}



	/**
	 * @return the jButtonBrowseIMG
	 */
	public JButton getJButtonBrowseIMG() {
		return JButtonBrowseIMG;
	}



	/**
	 * @param jButtonBrowseIMG the jButtonBrowseIMG to set
	 */
	public void setJButtonBrowseIMG(JButton jButtonBrowseIMG) {
		JButtonBrowseIMG = jButtonBrowseIMG;
	}



	/**
	 * @return the jTextFieldFname
	 */
	public JTextField getJTextFieldFname() {
		return JTextFieldFname;
	}



	/**
	 * @param jTextFieldFname the jTextFieldFname to set
	 */
	public void setJTextFieldFname(JTextField jTextFieldFname) {
		JTextFieldFname = jTextFieldFname;
	}



	/**
	 * @return the jTextFieldLname
	 */
	public JTextField getJTextFieldLname() {
		return JTextFieldLname;
	}



	/**
	 * @param jTextFieldLname the jTextFieldLname to set
	 */
	public void setJTextFieldLname(JTextField jTextFieldLname) {
		JTextFieldLname = jTextFieldLname;
	}



	/**
	 * @return the jTextFieldGroup
	 */
	public JTextField getJTextFieldGroup() {
		return JTextFieldGroup;
	}



	/**
	 * @param jTextFieldGroup the jTextFieldGroup to set
	 */
	public void setJTextFieldGroup(JTextField jTextFieldGroup) {
		JTextFieldGroup = jTextFieldGroup;
	}



	/**
	 * @return the jTextFieldAddressH
	 */
	public JTextField getJTextFieldAddressH() {
		return JTextFieldAddressH;
	}



	/**
	 * @param jTextFieldAddressH the jTextFieldAddressH to set
	 */
	public void setJTextFieldAddressH(JTextField jTextFieldAddressH) {
		JTextFieldAddressH = jTextFieldAddressH;
	}



	/**
	 * @return the jTextFieldAddressC
	 */
	public JTextField getJTextFieldAddressC() {
		return JTextFieldAddressC;
	}



	/**
	 * @param jTextFieldAddressC the jTextFieldAddressC to set
	 */
	public void setJTextFieldAddressC(JTextField jTextFieldAddressC) {
		JTextFieldAddressC = jTextFieldAddressC;
	}



	/**
	 * @return the jTextFieldPhoneH
	 */
	public JTextField getJTextFieldPhoneH() {
		return JTextFieldPhoneH;
	}



	/**
	 * @param jTextFieldPhoneH the jTextFieldPhoneH to set
	 */
	public void setJTextFieldPhoneH(JTextField jTextFieldPhoneH) {
		JTextFieldPhoneH = jTextFieldPhoneH;
	}



	/**
	 * @return the jTextFieldPhoneM
	 */
	public JTextField getJTextFieldPhoneM() {
		return JTextFieldPhoneM;
	}



	/**
	 * @param jTextFieldPhoneM the jTextFieldPhoneM to set
	 */
	public void setJTextFieldPhoneM(JTextField jTextFieldPhoneM) {
		JTextFieldPhoneM = jTextFieldPhoneM;
	}



	/**
	 * @return the jTextFieldPhoneP
	 */
	public JTextField getJTextFieldPhoneP() {
		return JTextFieldPhoneP;
	}



	/**
	 * @param jTextFieldPhoneP the jTextFieldPhoneP to set
	 */
	public void setJTextFieldPhoneP(JTextField jTextFieldPhoneP) {
		JTextFieldPhoneP = jTextFieldPhoneP;
	}



	/**
	 * @return the jTextFieldEmailPers
	 */
	public JTextField getJTextFieldEmailPers() {
		return JTextFieldEmailPers;
	}



	/**
	 * @param jTextFieldEmailPers the jTextFieldEmailPers to set
	 */
	public void setJTextFieldEmailPers(JTextField jTextFieldEmailPers) {
		JTextFieldEmailPers = jTextFieldEmailPers;
	}



	/**
	 * @return the jTextFieldEmailProf
	 */
	public JTextField getJTextFieldEmailProf() {
		return JTextFieldEmailProf;
	}



	/**
	 * @param jTextFieldEmailProf the jTextFieldEmailProf to set
	 */
	public void setJTextFieldEmailProf(JTextField jTextFieldEmailProf) {
		JTextFieldEmailProf = jTextFieldEmailProf;
	}



	/**
	 * @return the jTextFieldWebPage
	 */
	public JTextField getJTextFieldWebPage() {
		return JTextFieldWebPage;
	}



	/**
	 * @param jTextFieldWebPage the jTextFieldWebPage to set
	 */
	public void setJTextFieldWebPage(JTextField jTextFieldWebPage) {
		JTextFieldWebPage = jTextFieldWebPage;
	}



	/**
	 * @return the jButtonValidate
	 */
	public JButton getJButtonValidate() {
		return JButtonValidate;
	}



	/**
	 * @param jButtonValidate the jButtonValidate to set
	 */
	public void setJButtonValidate(JButton jButtonValidate) {
		JButtonValidate = jButtonValidate;
	}
}
